home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Herois
/
Codigo.Cst
/
00083_Script_UniUltra2
< prev
next >
Wrap
Text File
|
1999-03-19
|
1KB
|
45 lines
property sprAnima, periodo, tempo, prefixo
property numAnimacoes, numAnima
on getBehaviorDescription
return "Troca animacoes de sprites (a primeira ja deve estar setada)"
end
on getPropertyDescriptionList
set p_list = [ ¼
#sprAnima: [ #comment: "Sprite com animacao",¼
#format: #integer,¼
#default: 0 ],¼
#periodo: [ #comment: "Periodo antes da troca",¼
#format: #integer,¼
#default: 600 ],¼
#prefixo: [ #comment: "Prefixo",¼
#format: #string,¼
#default: "Anima" ],¼
#numAnimacoes: [ #comment: "Numero de animacoes",¼
#format: #integer,¼
#default: 2 ]¼
]
return p_list
end
on beginSprite me
if sprAnima = 0 then set sprAnima = the spriteNum of me
set tempo = 0
set numAnima = 1
end
on idleSprite
if tempo = 0 then set tempo = the timer
if the timer - tempo > periodo then
set numAnima = numAnima + 1
if numAnima > numAnimacoes then set numAnima = 1
set nomePrim = prefixo & numAnima & "-prim"
set nomeUlt = prefixo & numAnima & "-ult"
set the memberPrim of sprite sprAnima to nomePrim
set the memberUlt of sprite sprAnima to nomeUlt
sendSprite(sprAnima,#inicializaAnima)
set tempo = the timer
end if
end